Skip to content

refactor: centralize grammar ownership#208

Open
rlippmann wants to merge 1 commit into
mainfrom
grammar-readonly
Open

refactor: centralize grammar ownership#208
rlippmann wants to merge 1 commit into
mainfrom
grammar-readonly

Conversation

@rlippmann

@rlippmann rlippmann commented Jul 25, 2026

Copy link
Copy Markdown
Owner

What changed

  • re-exported the supported read-only grammar helpers from the package root and locked that surface into the public API contract
  • moved syntax-start and canonical parsing ownership back into context_compiler.grammar so engine.py no longer duplicates directive-start matching logic
  • kept the grammar-to-engine parsed-directive seam explicitly internal and updated internal tests to point syntax-boundary checks at grammar

Why

  • core grammar should be the single syntax authority inside this repository
  • consumers that need grammar validation/rendering should rely on the supported grammar contract instead of duplicated syntax logic
  • the engine should keep semantic/state behavior while depending on grammar through a clearly internal seam rather than overlapping syntax helpers
  • related to Review public API mutation boundaries #201

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant